package ahuy;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class mang2chieu {

	public static void main(String[] args) throws IOException {
		mang2c();
	}

	private static void mang2c() throws IOException{

		
		
			String line;
			BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
			
			System.out.println("nhap vao so dong: ");
			line = read.readLine	();
			int m =Integer.parseInt(line);
			System.out.println("nhap vao so cot: ");
			line = read.readLine	();
			int n = Integer.parseInt( line ); 
			
			int mang [][]= new int [m][n];
			for (int i = 0; i < m; i++) {
				for (int j = 0; j < n; j++) {
					System.out.println("mag hai chieu ["+i+"]["+j+"] : "
							+ "" +mang[i][j]);
					
				
			
				while (i<n)
				{
					System.out.println("Nhap phan tu thu "+(i+1)+": ");
					line = read.readLine();
					mang [i][j] =Integer.parseInt(line); 
					i++;
				
				for(int j1=0 ;j<n;j++){
					System.out.println("arr["+i+"][ "+j+"]=: "+mang[i] [j]);
				}
				
			}
			
			
			
			
			
		} 
			
}

		
		}
}